/* ---------------------------------------------------------------------- */
/* Add tables                                                             */
/* ---------------------------------------------------------------------- */

GO


/* ---------------------------------------------------------------------- */
/* Add table "dezrepo_permissions"                                        */
/* ---------------------------------------------------------------------- */

GO


CREATE TABLE [dezrepo_permissions] (
    [prm_username] VARCHAR(50) NOT NULL,
    [prm_projectfilename] VARCHAR(250) NOT NULL,
    [permission] VARCHAR(50),
    PRIMARY KEY ([prm_username], [prm_projectfilename])
)
GO


/* ---------------------------------------------------------------------- */
/* Add table "dezrepo_projects"                                           */
/* ---------------------------------------------------------------------- */

GO


CREATE TABLE [dezrepo_projects] (
    [projectfilename] VARCHAR(250) NOT NULL,
    [projectname] VARCHAR(250) NOT NULL,
    [projectdescription] VARCHAR(250),
    [latestversion] NUMERIC,
    [lockedby] VARCHAR(50),
    [lockeddate] VARCHAR(20),
    [lastupdateby] VARCHAR(50),
    [lastupdatedate] VARCHAR(20),
    [dezignversionnumber] VARCHAR(10),
    PRIMARY KEY ([projectfilename])
)
GO


/* ---------------------------------------------------------------------- */
/* Add table "dezrepo_projectversions"                                    */
/* ---------------------------------------------------------------------- */

GO


CREATE TABLE [dezrepo_projectversions] (
    [prv_projectfilename] VARCHAR(250) NOT NULL,
    [versionnumber] NUMERIC NOT NULL,
    [commitdate] VARCHAR(20),
    [prv_username] VARCHAR(50),
    [projectdata] VARBINARY(max),
    [changecomment] VARCHAR(250),
    [dezignversionnumber] VARCHAR(10),
    PRIMARY KEY ([prv_projectfilename], [versionnumber])
)
GO


/* ---------------------------------------------------------------------- */
/* Add table "dezrepo_settings"                                           */
/* ---------------------------------------------------------------------- */

GO


CREATE TABLE [dezrepo_settings] (
    [settingname] VARCHAR(30) NOT NULL,
    [settingvalue] VARCHAR(100),
    PRIMARY KEY ([settingname])
)
GO


/* ---------------------------------------------------------------------- */
/* Add table "dezrepo_users"                                              */
/* ---------------------------------------------------------------------- */

GO


CREATE TABLE [dezrepo_users] (
    [username] VARCHAR(50) NOT NULL,
    [userpassword] VARCHAR(50),
    [lastlogindate] VARCHAR(20),
    [userrights] VARCHAR(100),
    [defaultpermission] VARCHAR(20),
    PRIMARY KEY ([username])
)
GO

